﻿#include <iostream>
using namespace std;
#include <vector>
#include <numeric>
//常用算术生成算法
void test01()
{
	vector<int>v;
	for (int i = 0; i <= 100; i++)
	{
		v.push_back(i);
	}
	cout<<accumulate(v.begin(),v.end(),0)<<endl;  //总和为5050
	cout << accumulate(v.begin(), v.end(), 1000) << endl;  //总和为6050
	//参数3是起始的累加值
}
int main()
{
	test01();
}